<template>
  <div>
    <NavType />
    <List />
    <Recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor" />
    <Brand />
  </div>
</template>

<script>
import { requestFloorList } from "@/api";
import List from "./List";
import Recommend from "./Recommend";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";
// import { mapState } from 'vuex';

export default {
  name: "Home",
  data() {
    return {
      floorList: [],
    };
  },
  components: { List, Recommend, Rank, Like, Floor, Brand },
  mounted() {
    //初始化floor获取数据
    this.getrequestFloorList();
  },
  methods: {
    //请求楼层的函数
    async getrequestFloorList() {
      const re = await requestFloorList();
      this.floorList = re;
    },
  },
};
</script>

<style scoped lang="less">
</style>